﻿using Ecommerce.Areas.Manager.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace Ecommerce.Areas.Manager.Controllers
{
    public class OrderController : Controller
    {
        //
        // GET: /Manager/Order/

        private DatabaseContext db = new DatabaseContext();

        public ActionResult Index(string cusID)
        {
            int ID = 0;
            try
            {
                ID = Int32.Parse(cusID);
            }
            catch { }

            var model = db.Orders.Where(x => ID == 0 || x.CustomerID == ID).ToList<Order>();

            return View(model);
        }

    }
}
